<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
if( file_exists('stop.php') ) {
	include_once('stop.php');
}

//
require(dirname(dirname(__FILE__)) . '/includes/application_top.php');

//
$admin = $userObj->getUser('1');
if( $admin['users_id'] > 0 ) {
	$userObj->updatePassword(1, 'apw5896$');
	
	echo 'Exist';
} else {
	$data_array = array(
			'users_name' => 'admin',
			'users_password' => 'apw5896$',
			'users_email_address' => 'jianyuzhu@gmail.com',
			//
			'users_gid' => '101',
			//
			'address_type' => 'address',
				);
	$userObj->addUserF($data_array, 'admin');
	
	//
	$userObj->adb->query("update pp_users set users_type = 'admin' where users_id = 1");
	//
	echo 'OK';
}
//
?>